package com.mzpai.web.handler;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.mzpai.board.model.OperateCashLog;
import com.mzpai.board.model.OperateFlowLog;
import com.mzpai.board.vo.OperateCashLogReqVo;
import com.mzpai.board.vo.OperateFlowLogReqVo;
import com.mzpai.board.vo.OperateOneDayCashLogDetailVo;
import com.mzpai.board.vo.OperateOneDayFlowLogDetailVo;

public class BoardHandlerUtil {
	
	
	
	/**
	 * 统计流量日志平台总数
	 * @param operateFlowReqVo
	 * @return
	 */
	public static OperateOneDayFlowLogDetailVo countOneDayFlowLogPlateFormTotal(OperateFlowLogReqVo operateFlowReqVo,List<OperateFlowLog> queryOperateFlowLogList){
		
		OperateOneDayFlowLogDetailVo plateFormDayFlowDetailVo=new OperateOneDayFlowLogDetailVo();
		Map<String,String> plateFormMapDetail=new HashMap<String,String>();
		plateFormDayFlowDetailVo.setStoreId("0");
		plateFormDayFlowDetailVo.setStoreName("平台");
		plateFormDayFlowDetailVo.setMapDetail(plateFormMapDetail);
		for(OperateFlowLog flowLog:queryOperateFlowLogList){
			String kindCode=flowLog.getKindCode();
			int total=flowLog.getTotal();
			int lastWeekTotal=flowLog.getLastWeekTotal();
			int lastDayTotal=flowLog.getLastDayTotal();
			plateFormMapDetail.put(kindCode, total+","+lastWeekTotal+","+lastDayTotal);
		}
		return plateFormDayFlowDetailVo;
	}
	
	
	 /**
	  *统计交易平台总数
	 * @param operateCashLogReqVo
	 * @return
	 */
	public static OperateOneDayCashLogDetailVo countOperateOneDayCashLogPlateFormTotal(OperateCashLogReqVo operateCashLogReqVo,List<OperateCashLog> qeryOperateCashLogList){
		 
		OperateOneDayCashLogDetailVo plateFormDayCashDetailVo=new OperateOneDayCashLogDetailVo();
		Map<String,String> plateFormMapDetail=new HashMap<String,String>();
		plateFormDayCashDetailVo.setStoreId("0");
		plateFormDayCashDetailVo.setStoreName("平台");
		plateFormDayCashDetailVo.setMapDetail(plateFormMapDetail);
		for(OperateCashLog cashLog:qeryOperateCashLogList){
			String kindCode=cashLog.getKindCode();
			Double total=cashLog.getTotal();
			Double lastWeekTotal=cashLog.getLastWeekTotal();
			Double lastDayTotal=cashLog.getLastDayTotal();
			plateFormMapDetail.put(kindCode, total+","+lastWeekTotal+","+lastDayTotal);
		}
		return plateFormDayCashDetailVo;
	 }

	
	/**
	 * 设置精度
	 * @param oneDayCashDetailVo
	 */
	/*public static void setPrecision(OperateOneDayCashLogVo oneDayCashDetailVo){
		BigDecimal bg1 = new BigDecimal(oneDayCashDetailVo.getH1()).setScale(2, RoundingMode.UP);
		Double h1=bg1.doubleValue();
		BigDecimal bg2 = new BigDecimal(oneDayCashDetailVo.getH2()).setScale(2, RoundingMode.UP);
		Double h2=bg2.doubleValue();
		BigDecimal bg3 = new BigDecimal(oneDayCashDetailVo.getH3()).setScale(2, RoundingMode.UP);
		Double h3=bg3.doubleValue();
		BigDecimal bg4 = new BigDecimal(oneDayCashDetailVo.getH4()).setScale(2, RoundingMode.UP);
		Double h4=bg4.doubleValue();
		BigDecimal bg5 = new BigDecimal(oneDayCashDetailVo.getH5()).setScale(2, RoundingMode.UP);
		Double h5=bg5.doubleValue();
		BigDecimal bg6 = new BigDecimal(oneDayCashDetailVo.getH6()).setScale(2, RoundingMode.UP);
		Double h6=bg6.doubleValue();
		BigDecimal bg7 = new BigDecimal(oneDayCashDetailVo.getH7()).setScale(2, RoundingMode.UP);
		Double h7=bg7.doubleValue();
		BigDecimal bg8 = new BigDecimal(oneDayCashDetailVo.getH8()).setScale(2, RoundingMode.UP);
		Double h8=bg8.doubleValue();
		BigDecimal bg9 = new BigDecimal(oneDayCashDetailVo.getH9()).setScale(2, RoundingMode.UP);
		Double h9=bg9.doubleValue();
		BigDecimal bg10 = new BigDecimal(oneDayCashDetailVo.getH10()).setScale(2, RoundingMode.UP);
		Double h10=bg10.doubleValue();
		BigDecimal bg11 = new BigDecimal(oneDayCashDetailVo.getH11()).setScale(2, RoundingMode.UP);
		Double h11=bg11.doubleValue();
		BigDecimal bg12 = new BigDecimal(oneDayCashDetailVo.getH12()).setScale(2, RoundingMode.UP);
		Double h12=bg12.doubleValue();
		BigDecimal bg13 = new BigDecimal(oneDayCashDetailVo.getH13()).setScale(2, RoundingMode.UP);
		Double h13=bg13.doubleValue();
		BigDecimal bg14 = new BigDecimal(oneDayCashDetailVo.getH14()).setScale(2, RoundingMode.UP);
		Double h14=bg14.doubleValue();
		BigDecimal bg15 = new BigDecimal(oneDayCashDetailVo.getH15()).setScale(2, RoundingMode.UP);
		Double h15=bg15.doubleValue();
		BigDecimal bg16 = new BigDecimal(oneDayCashDetailVo.getH16()).setScale(2, RoundingMode.UP);
		Double h16=bg16.doubleValue();
		BigDecimal bg17 = new BigDecimal(oneDayCashDetailVo.getH17()).setScale(2, RoundingMode.UP);
		Double h17=bg17.doubleValue();
		BigDecimal bg18 = new BigDecimal(oneDayCashDetailVo.getH18()).setScale(2, RoundingMode.UP);
		Double h18=bg18.doubleValue();
		BigDecimal bg19 = new BigDecimal(oneDayCashDetailVo.getH19()).setScale(2, RoundingMode.UP);
		Double h19=bg19.doubleValue();
		BigDecimal bg20 = new BigDecimal(oneDayCashDetailVo.getH20()).setScale(2, RoundingMode.UP);
		Double h20=bg20.doubleValue();
		BigDecimal bg21 = new BigDecimal(oneDayCashDetailVo.getH21()).setScale(2, RoundingMode.UP);
		Double h21=bg21.doubleValue();
		BigDecimal bg22 = new BigDecimal(oneDayCashDetailVo.getH22()).setScale(2, RoundingMode.UP);
		Double h22=bg22.doubleValue();
		BigDecimal bg23 = new BigDecimal(oneDayCashDetailVo.getH23()).setScale(2, RoundingMode.UP);
		Double h23=bg23.doubleValue();
		BigDecimal bg24 = new BigDecimal(oneDayCashDetailVo.getH24()).setScale(2, RoundingMode.UP);
		Double h24=bg24.doubleValue();
		oneDayCashDetailVo.setH1(h1);
		oneDayCashDetailVo.setH2(h2);
		oneDayCashDetailVo.setH3(h3);
		oneDayCashDetailVo.setH4(h4);
		oneDayCashDetailVo.setH5(h5);
		oneDayCashDetailVo.setH6(h6);
		oneDayCashDetailVo.setH7(h7);
		oneDayCashDetailVo.setH8(h8);
		oneDayCashDetailVo.setH9(h9);
		oneDayCashDetailVo.setH10(h10);
		oneDayCashDetailVo.setH11(h11);
		oneDayCashDetailVo.setH12(h12);
		oneDayCashDetailVo.setH13(h13);
		oneDayCashDetailVo.setH14(h14);
		oneDayCashDetailVo.setH15(h15);
		oneDayCashDetailVo.setH16(h16);
		oneDayCashDetailVo.setH17(h17);
		oneDayCashDetailVo.setH18(h18);
		oneDayCashDetailVo.setH19(h19);
		oneDayCashDetailVo.setH20(h20);
		oneDayCashDetailVo.setH21(h21);
		oneDayCashDetailVo.setH22(h22);
		oneDayCashDetailVo.setH23(h23);
		oneDayCashDetailVo.setH24(h24);
	}*/
	
}
